//普通队列的类
function Queue() { 
    //基于数组
    this.items = [];
    //队列的方法enqueue dequeue  front isEmpty size toString
    Queue.prototype.enqueue = function (element) { 
        //在对尾加入元素
        this.items.push(element);
        return true
     };
    Queue.prototype.dequeue = function () {
        //删除对首元素并返回删除的元素
        return this.items.shift();
     };
    Queue.prototype.front = function () { 
         //查看对首元素，不做其他操作
        return this.items[0]
      };
    Queue.prototype.isEmpty = function () { 
        return this.items.length == 0
     };
    Queue.prototype.size = function () { 
        return this.items.length
     };
    Queue.prototype.toString = function () {
        let resStr = '';
        this.items.forEach((item,idx)=>{
            resStr += item + ' ';
        })
        return resStr
      }
 }